package com.greenhouse9.prog07;

import java.util.*;
public class Item {

    public String name;
    public String description;
    public String headline;
    public String url;
    public String availability;
    public String code;
    public String personId;
    public String productId;
    public String image;
    public String review;
    public String affiliate;
    public String price;
    public String priceLabel;
    public String point;
    public String shipping;
    public String category;
    public String categoryIdPath;
    public String brands;
    public String janCode;
    public String model;
    public String isbnCode;
    public String store;

    public String code1;
    public String name1;

    public XmlObject yahooItemInfo;

    private HashMap <String, Integer> hm = new HashMap <String, Integer>();

    public void init(){

        //yahoo�ˑ�
        for ( int i = 0; i< yahooItemInfo.child.size(); i ++){
            hm.put(yahooItemInfo.child.get(i).name, i);
        }
        this.name1 = yahooItemInfo.child.get( hm.get("Name") ).getFirstChildValue();
        this.code1 = yahooItemInfo.child.get( hm.get("Code") ).getFirstChildValue();
        this.url = yahooItemInfo.child.get( hm.get("Url") ).getFirstChildValue();
        this.isbnCode = yahooItemInfo.child.get( hm.get("IsbnCode") ).getFirstChildValue();
    }
}
